function [ com, dcom] = compliance(V,T,u,phi,e,nu)

    lambda = e*nu/((1+nu)*(1-2*nu));
    mu = 0.5*e/(1+nu);
    
    phib = max(0.001,min(1.0,phi.^3));
    phidiff = 3*phi.^2;
    
    ne = size(T,1);
    com = zeros(ne,1);
    dcom = zeros(ne,1);
    for i = 1:ne
        nd = T(i,:);
        vtx = V(nd,:);

        ke = stima4(vtx,lambda,mu);
        
        uloc = [u(nd(1)*2-1);u(nd(1)*2);u(nd(2)*2-1);u(nd(2)*2); ...
                u(nd(3)*2-1);u(nd(3)*2);u(nd(4)*2-1);u(nd(4)*2)];
            
        com(i)  =  uloc'*ke*uloc*phib(i);
        dcom(i) = -uloc'*ke*uloc*phidiff(i);
    end
end